package com.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.List;

import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.utils.PageUtils;
import com.utils.Query;

import com.dao.ZhiyuanDao;
import com.entity.ZhiyuanEntity;
import com.service.ZhiyuanService;
import com.entity.vo.ZhiyuanVO;
import com.entity.view.ZhiyuanView;

@Service("zhiyuanService")
public class ZhiyuanServiceImpl extends ServiceImpl<ZhiyuanDao, ZhiyuanEntity> implements ZhiyuanService {
	
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<ZhiyuanEntity> page = this.selectPage(
            new Query<ZhiyuanEntity>(params).getPage(),
            new EntityWrapper<ZhiyuanEntity>()
        );
        return new PageUtils(page);
    }
    
    @Override
	public PageUtils queryPage(Map<String, Object> params, Wrapper<ZhiyuanEntity> wrapper) {
		Page<ZhiyuanView> page =new Query<ZhiyuanView>(params).getPage();
        page.setRecords(baseMapper.selectListView(page,wrapper));
    	PageUtils pageUtil = new PageUtils(page);
    	return pageUtil;
 	}
    
    @Override
	public List<ZhiyuanVO> selectListVO(Wrapper<ZhiyuanEntity> wrapper) {
 		return baseMapper.selectListVO(wrapper);
	}
	
	@Override
	public ZhiyuanVO selectVO(Wrapper<ZhiyuanEntity> wrapper) {
 		return baseMapper.selectVO(wrapper);
	}
	
	@Override
	public List<ZhiyuanView> selectListView(Wrapper<ZhiyuanEntity> wrapper) {
		return baseMapper.selectListView(wrapper);
	}

	@Override
	public ZhiyuanView selectView(Wrapper<ZhiyuanEntity> wrapper) {
		return baseMapper.selectView(wrapper);
	}

}